/**
 * @(#)ServerHandler.java, 2012-2-22. 
 * 
 * Copyright 2012 Yodao, Inc. All rights reserved.
 * YODAO PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.buaaer.rpc;

import org.apache.mina.core.service.IoHandlerAdapter;
import org.apache.mina.core.session.IoSession;

/**
 *
 * @author wangheng
 *
 */
public class ServerHandler extends IoHandlerAdapter {
    
    
    public void messageReceived(IoSession session, Object message)
            throws Exception {
        System.out.println("message receive： " + message.toString());
        session.write(message.toString());
        
        Thread.sleep(Integer.parseInt(message.toString())*1000);
    }

    public void messageSent(IoSession session, Object message) throws Exception {
        System.out.println("message sent： " + message.toString());
    }

}
